package kosta.model;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;
@Repository
public class CategoryDaoImpl implements CategoryDao {
	@Resource(name="sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;
	
	//firstCategory 
	@Override
	public List<Map> selectAllFirstCategory() throws Exception {
		return this.sqlSessionTemplate.selectList("category.selectAllFirstCategory");
	}
	@Override
	public List<Map> selectSecondCategoryByFId(String firstCategoryId)
			throws Exception {
		return this.sqlSessionTemplate.selectList("category.selectSecondCategoryByFId",firstCategoryId);
	}
	@Override
	public List<Map> selectThirdCategoryBySId(String secondCategoryId)
			throws Exception {
		return this.sqlSessionTemplate.selectList("category.selectThirdCategoryBySId",secondCategoryId);
	}
	//selectProductInfoByTId
	@Override
	public List<ProductVO> selectProductInfoByTId(String thirdCategoryId)
			throws Exception {
		return this.sqlSessionTemplate.selectList("category.selectProductInfoByTId",thirdCategoryId);
	}
	@Override
	public ProductVO selectProductById(String productId) throws Exception {
		return this.sqlSessionTemplate.selectOne("category.selectProductById", productId);
	}

}

